@echo off
del *.map *.obj *.o *.mod 
echo ----------------------------
echo Building tasacs.dll with the g95 tool
echo Compiling HTypes.f90 
g95 -c c:\projects\tasacs\HTypes.f90 
echo Compiling strutils.f90 
g95 -c c:\projects\tasacs\strutils.f90 
echo Compiling OptimisationTypes.f90 
g95 -c c:\projects\tasacs\OptimisationTypes.f90 
echo Compiling SysUtils.f90 
g95 -c c:\projects\tasacs\SysUtils.f90 
echo Compiling dateutils.f90 
g95 -c c:\projects\tasacs\dateutils.f90 
echo Compiling dateutils.f90 
g95 -c c:\projects\tasacs\dateutils.f90 
echo Compiling matrix.f90 
g95 -c c:\projects\tasacs\matrix.f90 
echo Compiling Index.f90 
g95 -c c:\projects\tasacs\Index.f90 
echo Compiling Parameter.f90 
g95 -c c:\projects\tasacs\Parameter.f90 
echo Compiling ObsData.f90 
g95 -c c:\projects\tasacs\ObsData.f90 
echo Compiling Equations.f90 
g95 -c c:\projects\tasacs\Equations.f90 
echo Compiling ObsModel.f90 
g95 -c c:\projects\tasacs\ObsModel.f90 
echo Compiling Population.f90 
g95 -c c:\projects\tasacs\Population.f90 
echo Compiling QSort.f90 
g95 -c c:\projects\tasacs\QSort.f90 
echo Compiling ObjFunction.f90 
g95 -c c:\projects\tasacs\ObjFunction.f90 
echo Compiling Retro.f90 
g95 -c c:\projects\tasacs\Retro.f90 
echo Compiling Bootstrap.f90 
g95 -c c:\projects\tasacs\Bootstrap.f90 
echo Compiling Optimisation.f90 
g95 -c c:\projects\tasacs\Optimisation.f90 
echo Compiling xtasacs.f90 
g95 -c c:\projects\tasacs\g95\xtasacs.f90 

echo Using module definition file tasacs.def
echo linking with cdecl (omitting -mrtd option)
g95 -shared -o "c:\program files\tasacs\tasacsR.dll" HTypes.o strutils.o OptimisationTypes.o SysUtils.o dateutils.o matrix.o Index.o Parameter.o ObsData.o Equations.o ObsModel.o Population.o QSort.o ObjFunction.o Retro.o Bootstrap.o Optimisation.o xtasacs.o tasacs.def

del *.map *.obj *.o *.mod 
pause
echo ----------------------------